#include<stdio.h>

int deleteSame(int* num, int size)
{
	int left = 0;
	for (int right = 0; right < size; right++)
	{
		if (num[right] != num[left])
		{
			left++;
			num[left] = num[right];
		}
	}
	return left+1;
}

int main()
{
	int num[] = { 2,2,2,3,3,3,4,5,6 };
	int x = 0;
	x = deleteSame(num, 9);
	for (int i = 0; i < x; i++)
	{
		printf("%d ", num[i]);
	}
	return 0;
}